package com.app.designpatternslearn.behavior.mementopattern.code

class CareTaker {

    private val mementos = mutableListOf<Memento>()

    fun add(memento: Memento) = mementos.add(memento)

    fun get(index: Int) : Memento? = if (index < mementos.size) {
        mementos[index]
    } else null

}